const routes = [
  {
    path: '/home',
    name: 'home',
    component: () => import('../views/HomeView.vue'),
    children: [
      {
        path: '/home/homepage',
        name: 'homepage',
        meta: { title: '首页' },
        component: () => import('../components/HomePage.vue'),
      },
      {
        path: '/home/bbtpage',
        name: 'bbtpage',
        meta: { title: '爆爆团' },
        component: () => import('../components/BbtPage.vue'),
      },
      {
        path: '/home/indendpage',
        name: 'indendpage',
        meta: { title: '订单' },
        component: () => import('../components/IndendPage.vue'),
      },
      {
        path: '/home/minepage',
        name: 'minepage',
        meta: { title: '我的' },
        component: () => import('../components/MinePage.vue'),
      },
      {
        path: '/home',
        redirect: '/home/homepage',
      },
      {
        path: '*',
        component: () => import('../views/NotFound.vue')
      }
    ]
  },
  {
    path: '/shop/:id',
    name: 'shop',
    meta: { title: '店铺' },
    component: () => import('../views/ShopView.vue'),
    // children: [
    //   {

    //     path: '/shopcart/:goodsid',
    //     name: 'shopcart',
    //     meta: { title: '购物车' },
    //     component: () => import('../../src/components/ShopCart.vue'),
    //   }
    // ]
  },
  {
    path: '/search',
    name: 'search',
    meta: { title: '搜索' },
    component: () => import('../views/SearchView.vue')
  },
  {
    path: '/login',
    name: 'login',
    meta: { title: '登录' },
    component: () => import('../views/LoginView.vue')
  },
  {
    path: '/register',
    name: 'register',
    meta: { title: '注册' },
    component: () => import('../views/RegisterView.vue')
  },
  {
    path: '/save',
    name: 'save',
    meta: { title: '收藏' },
    component: () => import('../views/SaveView.vue')
  },
  {
    path: '/addresslist',
    name: 'addresslist',
    meta: { title: '收货地址' },
    component: () => import('../views/AddressList.vue')
  },
  {
    path: '/addressadd',
    name: 'addressadd',
    meta: { title: '收货地址' },
    component: () => import('../views/AddressAdd.vue')
  },
  {
    path: '/addressedit',
    name: 'addressedit',
    meta: { title: '收货地址' },
    component: () => import('../views/AddressEdit.vue')
  },
  {
    path: '/',
    redirect: '/login',
  },
  {
    path: '*',
    component: () => import('../views/NotFound.vue')
  }
]

export default routes;